<?php
declare (strict_types = 1);

namespace app\middleware;
use app\BaseController;

use think\facade\View;
use think\facade\Session;
use app\model\Node as ND;

class LoginCheck
{
    use \liliuwei\think\Jump;
    /**
     * 处理请求
     *
     * @param \think\Request $request
     * @param \Closure       $next
     * @return Response
     */
    public function handle($request, \Closure $next)
    {
        $res = Session::get('admin');
        if(!$res){
            $this->error("请登录后再访问","/index/index");
        }
        return $next($request);
    }
}
